<html>
<head><meta charset="utf-8"><title>rustc rustfmt PR · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html">rustc rustfmt PR</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="154406364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154406364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154406364">(Jan 04 2019 at 12:43)</a>:</h4>
<p>this seems like a significant enough change that it's good to be aware of it: <a href="https://github.com/rust-lang/rust/pull/57318" target="_blank" title="https://github.com/rust-lang/rust/pull/57318">https://github.com/rust-lang/rust/pull/57318</a></p>



<a name="154408570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154408570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> csmoe <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154408570">(Jan 04 2019 at 13:23)</a>:</h4>
<p>omg, for someone who has a large pending PR, rebasing disaster is coming <span class="emoji emoji-1f631" title="scream">:scream:</span></p>



<a name="154409400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154409400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154409400">(Jan 04 2019 at 13:38)</a>:</h4>
<p>in theory, as long as we've established the rustfmt configurations, running rustfmt on our own PR will address that problem</p>



<a name="154409413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154409413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154409413">(Jan 04 2019 at 13:38)</a>:</h4>
<p>but I haven't actually attempted it yet</p>



<a name="154413538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154413538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154413538">(Jan 04 2019 at 14:55)</a>:</h4>
<p>I've done that before and it works pretty well</p>



<a name="154413543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154413543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154413543">(Jan 04 2019 at 14:55)</a>:</h4>
<p>basically rustfmting each commit and then rebasing</p>



<a name="154413759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154413759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154413759">(Jan 04 2019 at 14:58)</a>:</h4>
<p>I want a script to rustfmt a branch before merging this</p>



<a name="154413900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154413900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154413900">(Jan 04 2019 at 15:00)</a>:</h4>
<p>I definitely want this to be done (at least tested, and ideally reformatted) automatically by <code>tidy</code> before merging it</p>



<a name="154413939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154413939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154413939">(Jan 04 2019 at 15:01)</a>:</h4>
<p>otherwise there are going to be PRs merged that don't obey the formatting rules afterwards, which will have to be reformatted again</p>



<a name="154417385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154417385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Björn Steinbrink <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154417385">(Jan 04 2019 at 15:56)</a>:</h4>
<p><span class="user-mention" data-user-id="116466">@Zoxc</span> </p>
<div class="codehilite"><pre><span></span>git rebase --exec <span class="s1">&#39;rustfmt $(git diff --name-only --no-renames --diff-filter=AM HEAD^!); git commit --amend --no-edit -a&#39;</span> master
</pre></div>


<p>should do</p>



<a name="154432033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154432033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154432033">(Jan 04 2019 at 19:48)</a>:</h4>
<p>Is this the flag day CR <span class="user-mention" data-user-id="116009">@nikomatsakis</span>  was referring to ? This is a good step <span class="user-mention" data-user-id="116122">@simulacrum</span> but we would need something like <code>git-clang-format</code> functionality for RustFmt so that we can just format the patch we are working on and not the entire file(s).</p>



<a name="154432272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154432272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154432272">(Jan 04 2019 at 19:51)</a>:</h4>
<p>Also, can we add a commit message to the PR <span class="user-mention" data-user-id="116122">@simulacrum</span>  ?<br>
<code>ls -lR | egrep '\.rs$' | wc -l
   13629</code><br>
Running that command gave me that ~13600 files but this patch seems to touch 1125 of them (my repo might not be updated). So, the rest files are formatted as per the RustFmt rules ?</p>



<a name="154432337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154432337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154432337">(Jan 04 2019 at 19:52)</a>:</h4>
<p><span class="user-mention" data-user-id="128294">@blitzerr</span> well you can just reformat the whole repo actually and when you rebase git will sort out the diffs -- but it would prob best to wait until the PR lands</p>



<a name="154432344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154432344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154432344">(Jan 04 2019 at 19:52)</a>:</h4>
<p>at least that's been my past experience</p>



<a name="154438811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154438811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154438811">(Jan 04 2019 at 21:33)</a>:</h4>
<p>The earliest we'll land it is in ~2 weeks and I think we might push it off another cycle or so (hopefully integrate it with CI simultaneously)</p>



<a name="154438824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc%20rustfmt%20PR/near/154438824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc.20rustfmt.20PR.html#154438824">(Jan 04 2019 at 21:33)</a>:</h4>
<p>I was hoping to get that all done over holidays but it didn't quite happen unfortunately -- only got the license PR landed</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>